/**************************************************************************
 *
 *      Copyright (c) 2005-2008 by Sunplus mMedia Technology Co., Ltd.
 *
 *  This software is copyrighted by and is the property of Sunplus mMedia
 *  Technology Co., Ltd. All rights are reserved by Sunplus mMedia Technology
 *  Co., Ltd. This software may only be used in accordance with the
 *  corresponding license agreement. Any unauthorized use, duplication,
 *  distribution, or disclosure of this software is expressly forbidden.
 *
 *  This Copyright notice MUST not be removed or modified without prior
 *  written consent of Sunplus mMedia Technology Co., Ltd.
 *
 *  Sunplus mMedia Technology Co., Ltd. reserves the right to modify this
 *  software without notice.
 *
 *  Sunplus mMedia Technology Co., Ltd.
 *  19, Innovation First Road, Science-Based Industrial Park,
 *  Hsin-Chu, Taiwan.
 *
 *
 **************************************************************************/

/**
 * @file		ptr_func.c
 * @brief		function pointer jump list
 * @author	Phil Lin
 * @since		2008-02-20
 * @date		2008-02-20
 */
//=============================================================================
//Header file
//=============================================================================
#include "general.h"
#include "ptr_func.h"
#include "cmd_func.h"
#include "os_msg.h"
#include "app_still_view.h"
#include "app_ui_power.h"
#include "audio_rw.h"
#include "video.h"
#include "app_usb.h"
#include "app_ui_osd.h"
#include "timer.h"
#include "sp1k_util_api.h"
#include "app_menu_tab.h"
#include "key_scan.h"

//=============================================================================
//Symbol
//=============================================================================
//-----------------------------------------------------------------------------
//Constant
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//Variable
//-----------------------------------------------------------------------------

//=============================================================================
//Program       
//=============================================================================

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_TestSnap
 * @param	ptr:test time
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_TestSnap(UINT16* ptr)
{
	return testTSnapRoutine(ptr);
}

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_TestPb
 * @param	ptr:test time
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_TestPb(UINT16* ptr)
{
	return testTPlaybackRoutine(ptr);
}

/********************Function pFunc_SelfSnapMSGSendShell ***************/
//Name:				void pFunc_SelfSnapMSGSendShell(void)
//Description:			The shell of function appSelfSnapMSGSend
//					For the function should run in common bank
//Input:				None
//Output:			None
//Created By:		Wei.Sun
//Created Time:		08-03-10 11:44
//Last Modify Time:	08-03-06 15:40
/*****************************************************/
void pFunc_SelfSnapMSGSendShell(void)
{
	appSelfSnapMSGSend();
}

/********************Function pFunc_SelfSnapMSGSendShell ***************/
//Name:				void pFunc_SelfSnapMSGSendShell(void)
//Description:			The shell of function appSelfSnapMSGSend
//					For the function should run in common bank
//Input:				None
//Output:			None
//Created By:		Wei.Sun
//Created Time:		08-04-09 11:44
//Last Modify Time:	08-04-10 11:40
/*****************************************************/
void pFunc_USBPwrSave(void)
{
	appUsbSavePwr();
}


//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_CardDetect
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_CardDetect(void)
{
	//printf("+\n");
	appSDPlugAction();
	return SUCCESS;
}

//
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_USBDetect
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_USBDetect(void)
{
	//printf("+\n");
	appUSBOutDetect();
	return SUCCESS;
}


//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_TVDetect
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	jintao.liu
 * @since		2008-03-13
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/
UINT8 pFunc_TVDetect(void)
{
	//printf("+\n");
	appTVOutDetect();
	return SUCCESS;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_AudioPb
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_AudioPb(void)
{
	audioPb();
	return SUCCESS;
}

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_AudioRec
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_AudioRec(void)
{
	audioRec();
	return SUCCESS;
}

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_VideoPb
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_VideoPb(void)
{
	videoPb();
	return SUCCESS;
}


//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_VideoRec
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_VideoRec(void)
{
	
	return videoRec();;
}

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_osdBusyShow
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_osdBusyShow(void)
{
	//appUiBusyShow(0);			
	return SUCCESS;
}

//-----------------------------------------------------------------------------
//pFunc_VoiceMemoStop
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_VoiceMemoStop
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_VoiceMemoStop(void)
{
	osMsgPost(SP1K_MSG_MEDIA_VOICE_MEMO_END);
	return SUCCESS;
}

//-----------------------------------------------------------------------------
//pFunc_SlideShowProc
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_SlideShowProc
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_SlideShowProc(void)
{
	osMsgPost(SP1K_MSG_SLIDE_SHOW_NEXT);
	return SUCCESS;
}

//-----------------------------------------------------------------------------
//pFunc_TestDscLife_span
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_TestDscLife_span
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/
#if LIFE_SPAN_TEST
UINT8 pFunc_TestDscLife_span(void)
{
	return testDscLife_span();
}
#endif

#if CMD_BTN_TEST
extern void btnTestTask(void);
//-----------------------------------------------------------------------------
//pFunc_btnTestTask
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_btnTestTask
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_btnTestTask(void)
{
	btnTestTask();
	return SUCCESS;
}
#endif /*CMD_BTN_TEST*/



#ifdef WHITE_LED
//-----------------------------------------------------------------------------
//pFunc_whiteLedCtrl
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_SlideShowProc
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Phil Lin
 * @since		2008-03-10
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/
UINT8 pFunc_whiteLedCtrl(void)
{
	appWhiteLedCtrl();
	return SUCCESS;
}
#endif /*WHITE_LED*/

//-----------------------------------------------------------------------------
//pFunc_SnapBurst
//-----------------------------------------------------------------------------
/**
 * @brief		pFunc_SnapBurst
 * @param	NONE
 * @retval	SUCCESS
 * @see
 * @author	Wen-Guo Gan
 * @since		2008-10-15
 * @todo		Something need to be done.
 * @bug		a bug need to be resolved.
*/

UINT8 pFunc_SnapBurst( void *ptr )
{
	UINT32 burstCnt = *(UINT32 *)ptr;

	return appSnapBurstCheck( burstCnt );
}

